<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">用户授权信息</div>
        <div class="layui-card-body">

            <div class="layui-form layui-form-pane" lay-filter="{$lay_table}">
                <input type="hidden" name="id" value="{$user.id}">
                <div class="layui-form-item">
                    <label class="layui-form-label">用户信息</label>
                    <div class="layui-input-block">
                        <input type="text" value="{$user.nickname} - {$user.mobile}" readonly
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item" pane>
                    <label class="layui-form-label">跟进方式</label>
                    <div class="layui-input-block">
                        {volist name="type_list" id="v"}
                        <input type="radio" name="type" value="{$key}" title="{$v}" {eq name="key" value="1" }checked{/eq} />
                        {/volist}
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:#f90c05;">*</span>跟进备注</label>
                    <div class="layui-input-block">
                        <textarea name="remark" lay-verify="required" placeholder="请输入..."
                                  class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input type="button" lay-submit lay-filter="{$lay_btn}" value="确认"
                               class="layui-btn">
                    </div>
                </div>
            </div>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend>以往跟进记录</legend>
            </fieldset>
            <ul class="layui-timeline">
                {volist name="list" id="vo"}
                <li class="layui-timeline-item">
                    <i class="layui-icon layui-timeline-axis"></i>
                    <div class="layui-timeline-content layui-text">
                        <h3 class="layui-timeline-title">
                            {$vo.create_time} 【{$vo.type_text}】
                        </h3>
                        <p>{$vo.remark}</p>
                    </div>
                </li>
                {/volist}
                <li class="layui-timeline-item">
                    <i class="layui-icon layui-timeline-axis"></i>
                    <div class="layui-timeline-content layui-text">
                        <div class="layui-timeline-title">已加载完 （ 最多显示最近100条跟进记录 ）</div>
                    </div>
                </li>
            </ul>


        </div>
    </div>
</div>

<script>
    layui.use(['index', 'form', 'set', 'table'], function () {
        const admin = layui.admin;
        const form = layui.form;
        form.render();

        form.on('submit({$lay_btn})', function (obj) {
            admin.req({
                url: "{:url('user/editFollow')}",
                data: obj.field,
                done: function (res) {
                    location.reload();
                }
            });
        });

    });
</script>
